Reciprocating hydraulic cylinders can provide power to drive some types of submersible pumps. In certain wells, such as coal bed methane and other oil and gas shallow wells, a reciprocating pump may be used to provide artificial lift to remove water from the wellbore or to pump hydrocarbons through production tubing. The reciprocating pump can be a positive-displacement single-acting diaphragm pump. Such reciprocating pumps may be driven by a reciprocating hydraulic cylinder, powered by hydraulic fluid from a surface unit. The reciprocating hydraulic cylinder may use a mechanical valve arrangement to switch stroke directions back-and-forth between extension and retraction of the hydraulic cylinder rod without having to vary or switch the pressure and flow direction of the incoming hydraulic fluid being supplied from the surface.